var dataMap = {};
function dataFormatter(obj) {
    var pList = ['南京市','无锡市','徐州市','常州市','苏州市','南通市','连云港市','淮安市','盐城市','扬州市','镇江市','泰州市','宿迁市'];
    var temp;
    var max = 0;
    for (var mon = 1; mon <= 12; mon++) {
        temp = obj[mon];
        for (var i = 0, l = temp.length; i < l; i++) {
            max = Math.max(max, temp[i]);
            obj[mon][i] = {
                name : pList[i],
                value : temp[i]
            }
        }
        obj[mon+'max'] = Math.floor(max/100) * 100;
    }
    return obj;
}

function dataMix(list) {
    var mixData = {};
    for (var i = 0, l = list.length; i < l; i++) {
        for (var key in list[i]) {
            if (list[i][key] instanceof Array) {
                mixData[key] = mixData[key] || [];
                for (var j = 0, k = list[i][key].length; j < k; j++) {
                    mixData[key][j] = mixData[key][j] 
                                      || {name : list[i][key][j].name, value : []};
                    mixData[key][j].value.push(list[i][key][j].value);
                }
            }
        }
    }
    return mixData;
}

dataMap.data = dataFormatter({
    //max : 400,
    1:[20.6, 22.4, 2.6, 16.4, 22.1, 15.5, 6.1, 9.4, 17.1, 23.5, 26.9, 19.4, 9.8],
    2:[121.2, 143.1, 30.8, 138.2, 140.4, 119.7, 32.1, 55.8, 72.6, 130.9, 144.8, 100.5, 38.7],
    3:[68.4, 61.1, 17.4, 54.6, 76.6, 69.6, 21.7, 28.2, 39.1, 87.6, 71.6, 60.2, 30.9],
    4:[97.6, 177.5, 71.6, 136.6, 141.4, 102.7, 34.2, 69.1, 51.4, 129.5, 96.2, 109.5, 74.1],
    5:[26.3, 96.6, 57.5, 57.8, 92.5, 52.6, 73.2, 70.2, 62.0, 65.5, 25.9, 30.8, 81.9],
    6:[111.8, 154.2, 67.4, 141.8, 135.5, 127.9, 47.4, 71.2, 133.9, 91.2, 87.5, 89.9, 46.4],
    7:[263.5, 285.2, 119.2, 330.0, 124.0, 297.0, 176.9, 228.8, 131.4, 235.6, 274.9, 219.5, 109.4],
    8:[158.8, 258.9, 174.2, 235.8, 190.1, 328.9, 92.5, 207.8, 318.4, 251.0, 212.6, 211.8, 188.8],
    9:[89.2, 89.9, 142.0, 70.9, 100.2, 117.6, 139.9, 150.1, 89.1, 85.0, 134.8, 89.7,211.1],
    10:[32.0, 25.6, 83.4, 18.4, 25.4, 12.3, 82.1, 41.8, 14.2, 22.6, 17.3, 11.8, 77.2],
    11:[97.9, 58.8, 57.5, 92.6, 61.1, 74.4, 73.1, 47.0, 45.0, 71.1, 79.3, 60.6, 55.2],
    12:[3.8, 8.3, 3.0, 7.9, 9.0, 8.3, 1.3, 0.0, 1.4, 2.3, 4.2, 2.5, 0.9]
 });

dataMap.dataAQI = dataFormatter({
	//'南京市','无锡市','徐州市',常州市','苏州市','南通市','连云港市',
	//'淮安市','盐城市','扬州市','镇江市','泰州市','宿迁市'
	1: [166, 138, 170, 142, 131, 126, 150, 157, 130, 150, 148, 146, 138],
    2: [105,  95, 116, 93,  90,  86,  102, 118, 93,  96,  93,  91,  119],
    3: [107,  96, 113, 97,  97,  97,  110, 120, 103, 108, 108, 108, 121],
    4: [ 93,  85, 91,  87,  85,  82,  91,  90,  75,  87,  91,  88,  92],
    5: [134, 111, 105, 114, 107, 109, 101, 125, 102, 114, 113, 114, 108],
    6: [130, 108, 117, 110, 96,  90,  105, 114, 80,  117, 110, 107, 119],
    7: [ 98, 105, 74,  94,  93,  86,  74,  87,  84,  95,  93,  88,  83],
    8: [ 59,  84, 69,  76,  83,  70,  72,  83,  67,  67,  74,  72,  73],
    9: [ 77,  77, 57,  71,  71,  66,  55,  63,  60,  60,  66,  62,  56],
    10:[ 96,  90, 75,  91,  84,  86,  69,  74,  73,  72,  81,  86,  72],
    11:[111, 107, 108, 93,  95,  91,  95,  98,  83,  83,  91,  104, 95],
    12:[ 98, 109, 120, 101, 109, 104, 122, 119, 103, 94,  98,  112, 100]
});
